<form action="index" method="POST" id="Listxml_Recordtype_Add" enctype="multipart/form-data" autocomplete="off">
<table width='100%'  border='0' cellspacing='0' cellpadding='0' class="table_title">
	<!--tao tac hidden!-->
	<tr>
		<td style="padding-left:7px;text-align:left;">
			<?php echo $this->formHidden("hdn_deleted_exist_file_id_list","",null); ?>
			<?php echo $this->formHidden("hdn_deleted_new_file_id_list","",null); ?>
			<?php echo $this->formHidden("hdn_xml_tag_list","",null); ?>
			<?php echo $this->formHidden("hdn_xml_value_list","",null); ?>
			<?php echo $this->formHidden("hdn_XmlTagValueList","",null); ?>
			<!--Bien hdn_deleted_exist_file_id_list dung de ...-->	
			<?php echo $this->formHidden("hdn_deleted_exist_file_id_list","",null); ?>	
			<?php echo $this->formHidden("hdn_object_id",$this->sRecordTypePk,null); ?>
			<?php echo $this->formHidden("hdn_object_id_list",$this->sRecordTypeIdList,null); ?>			
			<?php echo $this->formHidden("hdn_list_id","",null); ?>
			<?php echo $this->formHidden("hdn_department_list","",null); ?>						
		</td>
	</tr>
</table>
<?php
	//Khai bao su dung ham XML 
	global $dspDiv, $readonlyInEditMode, $disabledInEditMode, $formFielName;
	$this->dspDiv = 1;
	$this->readonlyInEditMode = true; $this->disabledInEditMode = true;
	//Cac mang goi tu Controller
	$arrConst = $this->arrConst;
	$arrResult = $this->arrResult;
	//$arrGroupRecord = $this->arrGroupRecord;
	?>
<div style="height:3px;"></div>
<div id ="contentXml" >
	<div id="header_conten" style="height: 15px;padding-bottom:15px;">
		<h1 class="large_label" style="padding-left:7px;text-align:left;"><?=$this->bodyTitle;?> 
			<div style="text-align:right; float:right;">
				<a  class="small_link" onClick = "btn_save_recordtype(document.getElementsByName('hdn_xml_tag_list'),document.getElementsByName('hdn_xml_value_list'),'');"><?=$arrConst['_GHI'] ?>&nbsp;|</a> 
				<a  class="small_link"  onclick="actionUrl('../index/');">&nbsp;<?=$arrConst['_QUAY_LAI'] ?>&nbsp;</a>
			</div>
		</h1>
	</div>
<!--Form nhap TTHC !-->
	<div id="body_conten1">
		
<!-- SO NGAY THU LY HS VA CAC GIAI DOAN  -->		
		<div style="margin:0px 0px 5px 0px;">
			<label><b>Thời gian thụ lý hồ sơ</b></label>
			<input style="width:10%" class="textbox" type="text"  id ="C_PROCESS_NUMBER_DATE" name="C_PROCESS_NUMBER_DATE" optional = "true"  value="<?=$arrResult['C_PROCESS_NUMBER_DATE']?>"  onchange="IsNumeric(this);">
			<span>&nbsp;ngày&nbsp;</span>
			<input style="width:10%" class="textbox" type="text"  id ="C_PROCESS_NUMBER_TIME" name="C_PROCESS_NUMBER_TIME" optional = "true"  value="<?=$arrResult['C_PROCESS_NUMBER_TIME']?>"  onchange="Ishours(this);">
			<span>&nbsp;giờ</span>
		</div>
		<?php //Tach Xau:
		$sCurrentStyleName == "odd_row";
		$arrPeriodCodeList = null;
		if ($arrResult['C_DEPARTMENT_LIST'] != ""){
			$arrPeriodList = explode("!@@!",$arrResult['C_DEPARTMENT_LIST']);
			if($arrPeriodList[0] != "") $arrPeriodCodeList = explode(";",$arrPeriodList[0]);
			if($arrPeriodList[1] != "") $arrPeriodDateList = explode(";",$arrPeriodList[1]);
			if($arrPeriodList[2] != "") $arrPeriodTimeList = explode(";",$arrPeriodList[2]);
			if($arrPeriodList[3] != "") $arrPeriodNumberList = explode(";",$arrPeriodList[3]);
		}	
		$arr_all_unit = Efy_Function_RecordFunctions::ecsGetAllDepartment();
		?>
		<div style="width:98%; margin:10px 10px 10xp 10px;">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center" class="list-table-data" id="table1">
				<col width="4%"><col width="8%"><col width="53%"><col width="20%">
				<tr  class="header">
					<td align="center" class="title">#</td>
					<td align="center" class="title">Thứ tự xử lý</td>
					<td align="center" class="title">Phòng ban</td>
					<td align="center" class="title">Thời gian giải quyết</td>
				</tr>	
			<?php for($index = 0;$index <sizeof($arr_all_unit);$index++){ 
					$iCountDate = 0;
					$iCountTime = 0;
					$iNumberProcess = 0;
					$check = 0;
					for($index2 = 0;$index2 <sizeof($arrPeriodCodeList);$index2++){ 
						if($arr_all_unit[$index]['id'] == $arrPeriodCodeList[$index2]){
							$check = 1;
							$iCountDate = trim($arrPeriodDateList[$index2]);
							$iCountTime = trim($arrPeriodTimeList[$index2]);
							$iNumberProcess = trim($arrPeriodNumberList[$index2]);
						}
					}		
					if ($sCurrentStyleName == "odd_row"){
						$sCurrentStyleName = "round_row";
					}else{
						$sCurrentStyleName = "odd_row";					
					} ?>				
				<tr class="<?=$sCurrentStyleName?> <?php if($check > 0) echo "  selected2 selected"; ?>"   onclick="check_color_recordtype(this,document.getElementById('<?=$arr_all_unit[$index]['id'] ?>'))">
					<td align="center">
						<input id ="<?=$arr_all_unit[$index]['id'] ?>" name="<?=$arr_all_unit[$index]['id'] ?>" class="textbox" type="checkbox" <?php if($check) echo "checked"; ?>> 
					</td>
					<td align="center">
						<input style="width:50%" class="textbox" type="text"  id ="STT_<?=$arr_all_unit[$index]['id'] ?>" name="STT_<?=$arr_all_unit[$index]['id'] ?>" optional = "true"  value="<?php if($iNumberProcess > 0) echo $iNumberProcess; ?>" onchange="IsNumeric(this);">
					</td>
					<td>	
						<?=$arr_all_unit[$index]['name'] ?>
					</td>	
					<td align="center">
						&nbsp; &nbsp; &nbsp;
						<input style="width:20%" class="textbox" type="text"  id ="DATE_<?=$arr_all_unit[$index]['id'] ?>" name="DATE_<?=$arr_all_unit[$index]['id'] ?>" optional = "true"  value="<?php if($iCountDate > 0) echo $iCountDate; ?>" onchange="IsNumeric(this);"> Ngày
						<input style="width:25%" class="textbox" type="text"  id ="TIME_<?=$arr_all_unit[$index]['id'] ?>" name="TIME_<?=$arr_all_unit[$index]['id']  ?>" optional = "true" value="<?php if($iCountTime > 0) echo $iCountTime; ?>" onchange="Ishours(this);"> giờ
					</td>
				</tr>								
			<?php } ?>	
			</table>
		</div>
<!-- CAN BO TIEP NHAN -->
		<div>
			<label><b>Cán bộ tiếp nhận hồ sơ</b></label>
			<div> &nbsp;</div>
		</div>
		<?php //Tach Xau:
		if ($arrResult['C_RECEIVE_LIST'] != ""){
			$arrReceiveStaff= explode("!@@!",$arrResult['C_RECEIVE_LIST']);
			$sReceiveFkList 	 = $arrReceiveStaff[0];
			if($sReceiveFkList != "") $sReceiveFkList = $sReceiveFkList;
			$arrReceiveFkList	=	explode(",",$sReceiveFkList);
			$arrReceivePositionNameList = explode(",",$arrReceiveStaff[1]); 
		}	?>
		<!-- <input type="hidden" value="<=$sReceiveFkList?>" id="ReceiveFkList" > -->
		<div id="id_receive">
			<input type="hidden" id ="select_receive" name="select_receive" type="checkbox" checked > <span ><!-- <=$arrConst['_THEM'] ?> <=$arrConst['_CB_TIEP_NHAN'] ?> </span>	-->			
		</div>
		<div id="ajax_receive" >	
			<!-- Ajax Treeview--><?php
			$this->formFielName	= "C_RECEIVE_ID_LIST";	
			$spRetHtml = "<div style='display:none'><input type='textbox' id='$this->formFielName' name='$this->formFielName' value='' hide='true' readonly optional = true xml_data=true xml_tag_in_db='' message=''></div>";		
			echo $spRetHtml.Efy_Xml::_generateHtmlForTreeUser($sReceiveFkList);	?>
		</div>
<!-- CAN BO TTHU LY -->	
		<div>
			<label><b>Cán bộ thụ lý hồ sơ</b></label>
			<div> &nbsp;</div>
		</div>
		<?php //Tach Xau:
		if ($arrResult['C_HANDLE_LIST'] != ""){
			$arrHandleStaff= explode("!@@!",$arrResult['C_HANDLE_LIST']);
			$sHandleFkList 	 = $arrHandleStaff[0];
			if($sHandleFkList != "") $sHandleFkList = $sHandleFkList;
			$arrHandleFkList	=	explode(",",$sHandleFkList);
			$arrHandlePositionNameList = explode(",",$arrHandleStaff[1]); 
		}	?>
		<!-- <input type="hidden" value="<=$sHandleFkList?>" id="HandleFkList" > -->
		<div id="id_handle">
			<input type="hidden" id ="select_handle" name="select_handle" type="checkbox"> <span ><!-- <=$arrConst['_THEM'] ?> <=$arrConst['_CB_THU_LY'] ?> </span> -->				
		</div>
		<div id="ajax_handle">	
			<!-- Ajax Treeview--><?php
			$this->formFielName	= "C_HANDLE_ID_LIST";	
			$spRetHtml = "<div style='display:none'><input type='textbox' id='$this->formFielName' name='$this->formFielName' value='' hide='true' readonly optional = true xml_data=true xml_tag_in_db='' message=''></div>";		
			echo $spRetHtml.Efy_Xml::_generateHtmlForTreeUser($sHandleFkList);	?>		
		</div>			
		<div id="clear"></div>
	</div>
</div>			
<!--Hien thi nut!-->			
<table 	width='99%'  border='0' cellspacing='0' cellpadding='0' align="center" class="table_title">		
	<tr>
		<td align="center">	
			<?=$this->formButton("btn_update","Ghi",array("type"=>"button","class"=>"link-button","onClick"=>"btn_save_recordtype(document.getElementsByName('hdn_xml_tag_list'),document.getElementsByName('hdn_xml_value_list'),'');"))?>								
			<?=$this->formButton('btn_back','Quay lại',array("type"=>"button","onClick"=>"actionUrl('../index/');","class"=>"link-button"))?>
		</td>
	</tr>			
</table>
</form>
<script type="text/javascript">
	$('#C_PROCESS_NUMBER_DATE').focus();
</script>
